package com.shop.feign;


import com.shop.domain.Detail;
import com.shop.domain.ProductDetails;
import com.shop.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;


@FeignClient(name = "goods")
public interface GoodsFeign {
    @GetMapping("/detail/findDetail")

     Result<Detail> fingDetail(@RequestParam Long id);

    /**
     * 条件查询商品详情表
     * @param iProductDetails
     * @return
     */
    @PostMapping("/ProductDetails/selectList")
    Result<List<ProductDetails>> select(@RequestBody ProductDetails iProductDetails);

    /**
     * 减库存
     * @param productId
     * @param num
     * @return
     */
    @GetMapping("/ProductDetails/reduceStock")
     Result reduceStock(@RequestParam Long productId, @RequestParam Integer num);
}
